package com.example.labb2da523b;

import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;

public class MenuHelper {
	
	public static boolean Menu(MenuItem item, Activity context) {
		Intent currentIntent = new Intent();
			if(item.getItemId()==R.id.action_piechart) {
				currentIntent.setClass(context, CircleDiagram.class);
				context.startActivity(currentIntent);
				return true;
			} else if(item.getItemId()==R.id.action_addexpense) {
				currentIntent.setClass(context, MainActivity.class);
				context.startActivity(currentIntent);
				return true;
			} else if(item.getItemId()==R.id.action_budget) {
				currentIntent.setClass(context, BudgetActivity.class);
				context.startActivity(currentIntent);
				return true;
			} else if(item.getItemId()==R.id.action_latestentries) {
				currentIntent.setClass(context, LatestTransactions.class);
				context.startActivity(currentIntent);
				return true;
			} else {
				return false;
			}
	}
}
